﻿namespace Stratrgy
{
    internal class Player
    {
        private string name;
        private IStrategy strategy;
        private int winCount;
        private int loseCount;
        private int gameCount;
        public Player(string name, IStrategy strategy)
        {
            this.name = name;
            this.strategy = strategy;
        }

        public Hand NextHand()
        {
            return strategy.NextHand();
        }

        public void Win()
        {
            this.strategy.Study(true);
            this.winCount++;
            this.gameCount++;
        }

        public void Lose()
        {
            this.strategy.Study(false);
            this.loseCount++;
            this.gameCount++;
        }

        public void Even()
        {
            this.gameCount++;
        }

        public override string ToString()
        {
            return $"[{this.name}:{this.gameCount} games, {this.winCount} win, {this.loseCount} lose]";
        }
    }
}
